<?php
session_start();
$User_ID= trim ($_SESSION['User_ID']);
?>
<?php

require_once("includes/database.php"); 





{	
$pet_owner_next = trim ($_POST['pet_owner_next']);
$owner_User_ID_next = trim ($_POST['owner_User_ID_next']);
$pet_ID_next = trim ($_POST['pet_ID_next']);
$select_vaccine_type =  trim ($_POST['select_vaccine_type']);
$select_vaccine_order = trim ($_POST['select_vaccine_order']);
$additional_note = trim ($_POST['additional_note']);
$date_of_next_vaccination = trim ($_POST['date_of_next_vaccination']);
date_default_timezone_set ("Asia/Hong_Kong");
$timezone= date_default_timezone_get();

$date =date("Y/m/d");

$tsql="UPDATE pet_info_db SET Next_Vaccination_Date= '{$date_of_next_vaccination}', Additional_Note= '{$additional_note}'
WHERE Pet_ID='{$pet_ID_next}' and Owner_User_ID='{$owner_User_ID_next}'";

sendEmail(getEmail($owner_User_ID_next),"Dear $pet_owner_next, <br><br><br><br> Greetings from petformanceveterinary@gmail.com <br><br><br>Good day!
It was good to have your pet in our clinic last time. And as part of our aim to offer the first rate pet care, we are looking forward to meeting with you again on $date_of_next_vaccination (yr-mm-dd) for your pet's $select_vaccine_order $select_vaccine_type Vaccination.
Should you have any inquiries regarding your appointment, please call our assistant at 0932-191-6916 / 0926-951-3633 or email us at petformanceveterinary@gmail.com. Thank you and God bless! <br><br><br> Additional Note: $additional_note.<br><br><br><br> Sincerely,<br><br><br> Petformance Veterinary- Animal Health and Wellness Clinic","Next Vaccination Schedule");

$data =  mysql_query($tsql,$con);

if( $data )
{
    /*echo "Connection established.\n";*/
	 $message = "Updating Next Immunization Date Successful!";
	 echo "<script type='text/javascript'>alert('$message');window.location = 'thesis_vet_page.php?page=1&pet_id=';</script>";
}
else
{
   $message = "Updating Next Immunization Date Failed.!";
	 echo "<script type='text/javascript'>alert('$message');window.location = 'thesis_vet_page.php?page=1&pet_id=';</script>";
     die( print_r( mysql_error(), true));
}
}

?>